Importing libraries

Import dataset

Creating label and feature matrices

Dividing data into training and testing datasets

Until now we have obtained the data. We divided it into training and test sets. we separated obtained seperate variables for the majority and miority classes and their labels for both sets.

Convex space learner

Parameters

Some Notes:

We are generating the 'labels' array now, an array of size 2xgen. This array will later be used as batch labels to train the discriminator (See Figure)

Borderline majority batch

An example of the function BMB generating a borderline majority neighbourhood of size 5. The majority class is first analyzed to find the borderline samples. This is the subset of majority class samples that are in the neb-earest neighbour set of at least one minority class sample. We call this function everytime we want to input such a batch as a part of the discriminator input. The other part of the discriminator input is to be generated by the generator. (See Figure)

An example of the function NMB generating a minority neighbourhood of size 5. We call this function everytime we want to input such a batch to the generator network

Network architecture

What needs to be done next: